{% extends 'finance_base.html' %}
{% block title %}New Transaction{% endblock %}
{% block stylesheet %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% url finance_static "js/CLEditor/jquery.cleditor.css" %}"/>
{% endblock%}

{% block javascript %}
{{ block.super }}
<script type="text/javascript" src="{% url finance_static "js/jquery.tablesorter.min.js" %}"></script>
<script type="text/javascript" src="{% url finance_static "js/CLEditor/jquery.cleditor.min.js" %}"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
    $("#id_date").datepicker({dateFormat: 'yy-mm-dd'});
    $("form table tr:even").addClass("even");
    var confgi = {
          width:        650, // width not including margins, borders or padding
          height:       150, // height not including margins, borders or padding
          controls:     // controls to add to the toolbar
                        "bold italic underline strikethrough subscript superscript | font size " +
                        "style | color highlight removeformat | bullets numbering | outdent " +
                        "indent | alignleft center alignright justify | undo redo | ",
          fonts:        // font names in the font popup
                        "Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond," +
                        "Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana",
          sizes:        // sizes in the font size popup
                        "1,2,3,4,5,6,7",
          styles:       // styles in the style popup
                        [["Paragraph", "<p>"], ["Header 1", "<h1>"], ["Header 2", "<h2>"],
                        ["Header 3", "<h3>"],  ["Header 4","<h4>"],  ["Header 5","<h5>"],
                        ["Header 6","<h6>"]],
          useCSS:       false, // use CSS to style HTML when possible (not supported in ie)
          docType:      // Document type contained within the editor
                        '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
          docCSSFile:   // CSS file used to style the document contained within the editor
                        "",
          bodyStyle:    // style to assign to document body contained within the editor
                        "margin:4px; font:10pt Arial,Verdana; cursor:text"
        };
    $("#id_detail").cleditor(confgi);
    $("#id_note").cleditor(confgi);

});
//]]>
</script>
{% endblock%}

{% block content %}
<div id="navi">
    <ul>
        <li>
        <a href="">ssss</a>
        </li>
    </ul>
</div>

{% if msg %}
    {{ msg }}
{% else %}
<form action="" method="post">
    <table class="form">
        <tr>
            <th>날짜</th>
            <th>항목</th>
            <th>출금/입금</th>
            <th>금액</th>
            <th>통장구분</th>
            <th>구분</th>
        </tr>
        <tr>
            <td>
                <div class="fieldWrapper">
                {{ form.date.errors }}
                <label for="id_date"></label>
                {{ form.date }}
                </div>
            </td>
            <td>
                <div class="fieldWrapper">
                {{ form.category.errors }}
                <label for="id_category"></label>
                {{ form.category }}
                </div>
            </td>
            <td>
                <div class="fieldWrapper">
                {{ form.type.errors }}
                <label for="id_type"></label>
                {{ form.type }}
                </div>
            </td>
            <td>
                <div class="fieldWrapper">
                {{ form.amount.errors }}
                <label for="id_amount"></label>
                {{ form.amount }}
                </div>
            </td>
            <td>
                <div class="fieldWrapper">
                {{ form.account.errors }}
                <label for="id_account"></label>
                {{ form.account }}
                </div>
            </td>
            <td>
                <div class="fieldWrapper">
                {{ form.location.errors }}
                <label for="id_location"></label>
                {{ form.location }}
                </div>
            </td>
        </tr>
        <tr>
            <th colspan=6>내용</th>
        </tr>
        <tr>
            <td colspan=6>
                <div class="fieldWrapper">
                {{ form.detail.errors }}
                <label for="id_detail"></label>
                {{ form.detail }}
                </div>
            </td>
        </tr>
        <tr>
            <th colspan=6>비고</th>
        </tr>
        <tr>
            <td colspan=6>
                <div class="fieldWrapper">
                {{ form.note.errors }}
                <label for="id_note"></label>
                {{ form.note }}
                </div>
            </td>
        </tr>
    </table>
    <input type="submit" value="submit">
</form>
{% endif %}
{% endblock %}